﻿<Window x:Class="PocketBook.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" 
        Height="550" Width="800" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/generic.xaml" />
            </ResourceDictionary.MergedDictionaries>
        
        <LinearGradientBrush x:Key="MainPanelBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="White" Offset="0" />
            <GradientStop Color="#93A0AF" Offset="1" />
        </LinearGradientBrush>

        <Style x:Key="PanelBorder" TargetType="Border">
            <Setter Property="Background" Value="White" />
            <Setter Property="BorderBrush" Value="#AAB3B3" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="CornerRadius" Value="4" />
        </Style>

        </ResourceDictionary>
    </Window.Resources>
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="_File" >
                <MenuItem Name="NewBook" Header="_New" InputGestureText="Ctrl+N" />
                <MenuItem Name="OpenBook" Header="_Open..." InputGestureText="Ctrl+O" />
                <MenuItem Name="SaveBook" Header="_Save" InputGestureText="Ctrl+S" />
                <MenuItem Name="SaveBookAs" Header="Save _As..." />
                <Separator/>
                <MenuItem Name="PrintPreview" Header="_Print Preview..."  />
                <MenuItem Name="PrintBook" Header="_Print"  InputGestureText="Ctrl+P" />
                <Separator/>
                <MenuItem Name="Exit" Header="E_xit" InputGestureText="Atl+F4" />
            </MenuItem>
        </Menu>

        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar>
                <ToolBar.Resources>
                    <Style TargetType="Image">
                        <Setter Property="Height" Value="24" />
                        <Setter Property="Stretch" Value="None" />
                    </Style>
                </ToolBar.Resources>
                <Button cal:Message.Attach="NewBook" ToolTip="New (Ctrl+N)">
                    <Image Source="/Assets/tool-new.png" />
                </Button>
                <Button cal:Message.Attach="OpenBook" ToolTip="Open (Ctrl+O)">
                    <Image Source="/Assets/tool-open.png" />
                </Button>
                <Button cal:Message.Attach="SaveBook" ToolTip="Save (Ctrl+S)" Style="{StaticResource ToolButtonStyle}">
                    <Image Source="/Assets/tool-save.png" />
                </Button>
                <Separator />
                <Button cal:Message.Attach="PrintBook" ToolTip="Print (Ctrl+P)" Style="{StaticResource ToolButtonStyle}">
                    <Image Source="/Assets/tool-print.png" />
                </Button>
            </ToolBar>
        </ToolBarTray>

        <Border Grid.Row="2" Background="{StaticResource MainPanelBrush}" Padding="10" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Border Style="{StaticResource PanelBorder}" Width="240" Grid.Column="0">
                    <ContentControl x:Name="DesignCatalog" />
                </Border>

                <ContentControl x:Name="DesignEditor" Grid.Column="1" VerticalAlignment="Center" />

                <Border Style="{StaticResource PanelBorder}" Grid.Column="2">
                    <ContentControl x:Name="BookLayout" cal:Message.Attach="[Event Loaded] = [Action NewBook]" />
                </Border>
            </Grid>
        </Border>

    </DockPanel>
</Window>
